package m.framework.web.view;

import java.util.List;

import m.framework.template.TemplateUtil;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 
 * @author wanyongming
 * @date 2011-7-26 下午5:25:04
 */
public class Include {
	private static Logger log = LoggerFactory.getLogger(Include.class);
	
	private List os;
	public Include(List  os){
		this.os=os;
	}
	
	public String getHead(){
		return page("/page/head.jsp");
	}
	
	public String getNavigate(){
		return page("/page/navigate.jsp");
	}
	
	public String page(String path){
		try{
			String text=TemplateUtil.getTemplateText(path);
			return TemplateUtil.getText(text, os.toArray());
		}catch(Exception ex){
			log.error("解析"+path+"出错!!",ex);;
			return "解析"+path+"出错!!!!!!";
		}
	}
}
